package org.kotboot.enums;

import org.kotboot.kit.K;

/**
 * Created by jisong.sun on 2017/9/14.
 */
public enum ESignTypeBak {

    MOB_SMS("mob-sms"),
    MOB_PWD("mob-pwd"),
    MAIL_CODE("mail-code"),
    MAIL_PWD("mail-pwd");

    private String type;
    ESignTypeBak(String type){
        this.type = type;
    }

    public static ESignTypeBak of(String type){
        if(K.isEmpty(type)) return null;
        ESignTypeBak[] values = ESignTypeBak.values();
        for (ESignTypeBak Etype:values){
            if(Etype.type.equals(type)){
                return Etype;
            }
        }
        return null;
    }

    public static boolean mobile(ESignTypeBak type){
        return MOB_PWD.equals(type) || MOB_SMS.equals(type);
    }

    public static boolean mail(ESignTypeBak type){
        return MAIL_CODE.equals(type) || MAIL_PWD.equals(type);
    }
}
